package com.sahyadri.web.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * String utility class
 * 
 * @author giramkm
 * 
 */
public class StringUtils {
	/**
     * <p>Converts a String to a List using separator.</p>
     * 
     */
	public static List<String> stringToList(String list, String separator) {
		if (list == null) {
			return new ArrayList<String>();
		}
		return Arrays.asList(list.split(separator));
	}
	public static void main(String[] args) {
		String str = "12:30 AM";
		System.out.println(str.length());
		System.out.println("Hours "+ str.substring(0, 2)+",");
		System.out.println("Min "+ str.substring(3, 5)+",");
		System.out.println("AM_PM "+ str.substring(6, 8)+",");
	}
}
